package org.columba.mail.gui.socialnet.selection;

import java.util.ArrayList;
import java.util.List;

import org.columba.api.selection.SelectionChangedEvent;
import org.columba.mail.folder.IMailFolder;
import org.columba.mail.gui.socialnet.SocialNetWorkActorVertex;

import edu.uci.ics.jung.graph.Vertex;

public class VertexSelectionChangedEvent extends SelectionChangedEvent
{
	private IMailFolder folder = null;
	
	private List<IMailFolder> folderTempList = new ArrayList<IMailFolder>();
	
	public VertexSelectionChangedEvent()
	{	
	}
	
	public VertexSelectionChangedEvent(IMailFolder folder)
	{
	    this.folder = folder;	
	}
	
	public VertexSelectionChangedEvent(List<Vertex> verList)
	{
		folderTempList.clear();
		for(int i=0; i<verList.size(); i++)
		{
			folderTempList.add(((SocialNetWorkActorVertex)verList.get(i)).getFolder());
		}
		if(folderTempList.size()>0)
		    this.folder = folderTempList.get(0);
	}
	
	public IMailFolder getSelectedFolder() 
	{
		return folder;
	}
	
	public List<IMailFolder> getAllSelectedFolders() {
		return folderTempList;
	}

}
